import androidx.compose.desktop.ui.tooling.preview.Preview
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.padding
import androidx.compose.material.CircularProgressIndicator
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.kotlin.demo.constant.Constants
import com.kotlin.demo.helper.DialogHelper

/**
 * 加载中弹窗
 */
@Composable
internal fun loadingDialog() {
    Box(modifier = Modifier.clickable {
        DialogHelper.dismissDialog()
    }){
        Column(
            horizontalAlignment = Alignment.CenterHorizontally,
            modifier = Modifier.padding(40.dp),
        ) {
            CircularProgressIndicator(modifier = Modifier.padding(bottom = 16.dp))
            Text(
                text = Constants.tipsContent.value, style = TextStyle(fontSize = 14.sp)
            )
        }
    }

}
